package com.wutoon.etl.vo;/**
 * @author Stephen Wu
 * @date 2022-12-04
 */

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName CommonResult
 * @Description TODO
 * @Author wuxy
 * @DateTime 2022/12/4 13:41
 **/
@Data
@NoArgsConstructor
public class CommonResult<T> {
    private int code;

    private String msg;

    private T data;

    public static <T> CommonResult<T> success(String msg, T data) {
        CommonResult<T> result = new CommonResult<>();
        result.setCode(0);
        result.setData(data);
        result.setMsg(msg);
        return result;
    }
}
